package com.weijin.controller;

import com.weijin.model.entities.User;
import com.weijin.model.vo.RestResultVo;
import com.weijin.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author WeiJin
 * @Version 1.0
 * @Date 2025/3/28 10:40
 */
@RestController
@RequestMapping("/user")
@Api(tags = "用户相关接口")
public class UserController {

    @Autowired
    private IUserService userService;

    @GetMapping("/allUsers")
    @ApiOperation("获取所有用户")
    public RestResultVo<List<User>> queryAllUsers() {
        List<User> users = userService.queryAllUsers();
        return RestResultVo.ok(users);
    }


}
